package com.wimcorp.magic.dataloader.behaviors;

import com.google.gwt.user.client.ui.CellPanel;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.wimcorp.magic.data.BehaviourData;
import com.wimcorp.magic.input.BehaviorInput;

public class BehaviorWidget {

	private String name;
	private CellPanel configurationPanel = new VerticalPanel();
	TextArea description = new TextArea();

	public BehaviorWidget(BehaviorInput behavior) {
		this.name = behavior.toString();
		initBehaviorDescription();
	}

	public static BehaviorWidget createBehaviorWidget(BehaviorInput behavior) {
		switch (behavior) {
		default:
			return new BehaviorWidget(behavior);
		}
	}

	public CellPanel getConfigurationPanel() {
		return configurationPanel;
	}

	private void initBehaviorDescription() {
		description.setHeight("60px");
		description.setWidth("250px");
		configurationPanel.add(description);
	}

	public void load(BehaviourData behaviour) {
		description.setText(behaviour.getDescription());

	}

	public String getName() {
		return name;
	}

	public String getDescription() {
		return description.getText();
	}
	
	
	
	

}
